package cn.group01.git.handler;

import cn.group01.git.common.CodeMsg;
import cn.group01.git.common.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理类
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResponseResult otherExceptionHandler(Exception e){
        e.printStackTrace();
        return ResponseResult.fail(CodeMsg.ERROR);
    }
}
